<?php

require_once 'BluesCoders/Context/Scope.php';

/**
 * Description of Descriptor
 *
 * @author miho
 */
class BluesCoders_Context_Descriptor {

    /**
     * Bean`s id
     * @var String
     */
    protected $_id;

    /**
     * Bean`s class
     * @var string 
     */
    protected $_class;

    /**
     * argumets to pass to constructor
     * @var array
     */
    protected $_constructorArgs = array();

    /**
     * Array of properties of bean
     * @var array
     */
    protected $_properties = array();

    /**
     * Scope of bean, default is Request.
     * Avaliable scopes are Request, Session and Application
     * @var int 
     */
    protected $_scope;

    /**
     * Loader id, used to load beans class
     * @var string
     */
    protected $_loaderId;

    /**
     * Shoud bean be instantiated when context is initialized
     * @var boolean 
     */
    protected $_instantiateAtStartup = true;

    public function  __construct() {
        $this->_scope = BluesCoders_Context_Scope::SINGLETON;
    }

    /**
     * Getter for bean id
     * @return String 
     */
    public function getId() {
        return $this->_id;
    }

    /**
     * Setter of bean id
     * @param String $value
     * @return BluesCoders_Context_Descriptor
     */
    public function setId($value) {
        $this->_id = $value;
        return $this;
    }

    /**
     * 
     * @return String 
     */
    public function getClass() {
        return $this->_class;
    }

    /**
     *
     * @param String $value
     * @return BluesCoders_Context_Descriptor
     */
    public function setClass($value) {
        $this->_class = $value;
        return $this;
    }

    public function getScope() {
        return $this->_scope;
    }

    public function setScope($value) {
        $this->_scope = (int)$value;
    }

    public function getLoaderId() {
        return $this->_loaderId;
    }

    public function setLoaderId($value) {
        $this->_loaderId = $value;
        return $this;
    }

    public function getConstructorArgs() {
        return $this->_constructorArgs;
    }

    public function getProperties() {
        return $this->_properties;
    }

    public function addProperty($name, $property) {
        $this->_properties[$name] = $property;
    }

}
?>
